"""**********************************
   Author: yuhengShi
   Time: 2022/1/24 11:22
   Project: pytorch_classification
**********************************"""
from dataclasses import dataclass, field
import numpy as np
from typing import Dict
import torch


@dataclass(frozen=True)
class Config:
    data_path: str = r"""C:\E\dataset\simplifyweibo_4_moods.csv"""
    category: Dict[int, str] = field(default_factory=lambda: {0: "喜悦",
                                                              1: "愤怒",
                                                              2: "厌恶",
                                                              3: "低落"})
    min_freq = 1
    max_vocab_len = 20000
    PAD = '<PAD>'
    UNK = '<UNK>'
    random_seed = 42
    epochs = 10
    # 统计seq_len的75%分位数
    padding_size = 105
    lr = 2e-5
    batch_size = 32
    tokenize_level = "char"
    device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')


conf = Config()
np.random.seed(Config.random_seed)

__all__ = ["conf"]

if __name__ == '__main__':
    con = Config()
    from dataclasses import asdict
    print(asdict(con))
